#ifndef CORE_TEXT_EDIT_H
#define CORE_TEXT_EDIT_H
#include <iostream>
#include <stdio.h>
#include <unistd.h>
#include <iostream>
#include <QtCore>
#include <QtGui/QTextEdit>
#include <QCompleter>
#include <QApplication>
#include <QtCore>
#include <QApplication>
#include <QtGui>
#include <QTextEdit>
#include <QAbstractItemModel>
#include <QCompleter>
#include <QStringListModel>
#include <QShortcut>
#include <QTextCodec>
#include <QSettings>
#include <QClipboard>
#include <QMessageBox>
#include <QtDebug>
#include <QDesktopServices>
#include <QHeaderView>
#include <QMap>
#include <QList>
#include <QStringList>

#include "main.h"





class Core_Text_Edit : public QTextEdit
{
     Q_OBJECT
//
public:
   Core_Text_Edit( QWidget * parent );
   bool replace(QString text, QString reptext, QTextDocument::FindFlags flag);
   QAbstractItemModel *modelFromFile(const QString& fileName);
   QCompleter *completer() const;
   QString textUnderCursor() const;
   QString GrepTextLines(int startline, int stopline );
   void selectLines(int debut, int fin);
protected:
    void setCompleter(QCompleter *completer);
    void keyPressEvent(QKeyEvent *e);
    void focusInEvent(QFocusEvent *e);
    void IndentText( bool make );
    QString GrepLineFromTxBloc( QTextBlock block );
    void contextMenuEvent( QContextMenuEvent *e );
    bool m_tabSpaces;
private:
    QTextCursor CurrentCursor;
    QTextCursor LastTabCursor;
    QClipboard  *baseram;
    QString currentTXTsel;
    QCompleter *c;
    QCompleter *completerbase;
    QStringList keywords;
    int loadwordsum;
    QSettings setter;
signals:

public slots:
    void initialize();
private slots:
void insertCompletion( QString completion );
void RebuildCompleter();
void AppendCurrentWord();
void ExportWord();
void ImportWords();

};
//
#endif // CORE_TEXT_EDIT_H

